/*
 * Copyright 2011 derek.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.aocore.awesomo;

import com.aocore.d2data.CharacterClass;
import com.aocore.d2data.SkillHand;
import com.aocore.d2data.SkillType;
import com.aocore.d2data.UnitType;
import java.util.List;

/**
 *
 * @author derek
 */
public class Player
{
    private UnitType unitType;
    private final int uid;
    private int life;
    private int mana;
    private int stamina;
    private int x;
    private int y;
    private String name;
    private CharacterClass charClass;
    private short level;
    private short partyID;
    private short killCount;
    private List<Skill> skills;

    public Player(int uid)
    {
        this.uid = uid;
    }

    public UnitType getUnitType()
    {
        return unitType;
    }

    public void setUnitType(UnitType unitType)
    {
        this.unitType = unitType;
    }

    public int getUid()
    {
        return uid;
    }

    public int getLife()
    {
        return life;
    }

    public void setLife(int life)
    {
        this.life = life;
    }

    public int getMana()
    {
        return mana;
    }

    public void setMana(int mana)
    {
        this.mana = mana;
    }

    public int getStamina()
    {
        return stamina;
    }

    public void setStamina(int stamina)
    {
        this.stamina = stamina;
    }

    public int getX()
    {
        return x;
    }

    public void setX(int x)
    {
        this.x = x;
    }

    public int getY()
    {
        return y;
    }

    public void setY(int y)
    {
        this.y = y;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public CharacterClass getCharClass()
    {
        return charClass;
    }

    public void setCharClass(CharacterClass charClass)
    {
        this.charClass = charClass;
    }

    public short getLevel()
    {
        return level;
    }

    public void setLevel(short level)
    {
        this.level = level;
    }

    public short getPartyID()
    {
        return partyID;
    }

    public void setPartyID(short partyID)
    {
        this.partyID = partyID;
    }

    public short getKillCount()
    {
        return killCount;
    }

    public void setKillCount(short killCount)
    {
        this.killCount = killCount;
    }

    public void addSkill(Skill skill)
    {
        skills.add(skill);
    }

    public Skill getSkill(SkillType skillType)
    {
        for (Skill skill : skills)
        {
            if (skillType.equals(skill.getSkill()))
            {
                return skill;
            }
        }

        return null;
    }

    public void assignSkill(SkillHand hand, SkillType type)
    {
        //TODO assign skill
    }
}
